<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<%
	xMode = Request("xMode")
	showSubMenu = "50"
	
	isPerm = ""
	If Request.Cookies("S_level") = "05" then 
		isPerm = "none"
	End if
	
	'## 부서 정보
	Set partRs=Server.CreateObject("ADODB.RecordSet")
	SQL = "SELECT itemCd, itemNm FROM tblComCode WHERE flag='Y' AND groupCd='0005' ORDER BY itemSeq"	
	partRs.open SQL, dbCon
	
	If partRs.eof Or partRs.bof Then 
	Else 
		Do Until partRs.eof Or partRs.bof
			partOptions = partOptions & "<option value='" & partRs("itemCd") & "'>" & partRs("itemNm") & "</option>" & vbCrlf
		partRs.movenext
		Loop 
	End If
%>
<!-- #include virtual=/inc/header_cross.inc.asp -->  

<script language="javascript">    
		 $(document).ready(function() {
			  var clareCalendar = {
			   monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
			   dayNamesMin: ['일','월','화','수','목','금','토'],
			   weekHeader: 'Wk',
			   dateFormat: 'yy-mm-dd',														// 날짜형식(2012-03-03)
			   autoSize: false,																	//자동리사이즈(false 이면 상위 정의에 따름)
			   changeMonth: true,															// true이면 월변경, false이면 월변경못함
			   changeYear: true,																// true이면 년변경, false이면 년변경못함
			   showMonthAfterYear: true,													//년 뒤에 월 표시
			   buttonImageOnly: true,														//이미지표시
			   //buttonText: '달력선택',														//버튼 텍스트 표시
			   //buttonImage: '/calendar.gif',												//이미지주소
			   //showOn: "both",																//엘리먼트와 이미지 동시 사용(both,button)
			   yearRange: 'c-99:c+99',													//1990년부터 2020년까지
			   maxDate: '+2Y',																	// 오늘부터6년후날짜까지만, '+0d' 오늘 이전 날짜만 선택
			   minDate: '-5y'
			  };
			  $("#findStartDt").datepicker(clareCalendar);
			  $("#findEndDt").datepicker(clareCalendar);
			  $("#incomeDt").datepicker(clareCalendar);
			  $("img.ui-datepicker-trigger").attr("style","margin-left:5px; vertical-align:middle; cursor:pointer;"); //이미지버튼 style적용
			  $("#ui-datepicker-div").hide(); //자동으로 생성되는 div객체 숨김  
		});
		
	   $(window).load(function(){
	       grid01List(1);
	       fnCommonInit();
	    });     
</script>

<BODY topmargin="0" leftmargin="0">
<!-- #include virtual=/inc/menu.inc.asp -->  

<!-- 검색 영역 시작 -->
<div style="text-align:left;margin-top:10px;">
<!-- #include virtual=/inc/subMenu.inc.asp --> 
<table border="0" cellpadding="0" cellspacing="0" width="1237" style="margin-left:5px;">
	<tr height="40">
		<td style="padding: 0px 0 0px 10px;background-image:url(/inc/layout/panel-title-light-bg.gif);font-weight:bold;text-align:left" width="100%" class="lTD_trbl"> &nbsp; 
			<input type="text" id="findStartDt" class="inputBox" style="width:70px;"> - <input type="text" id="findEndDt" class="inputBox" style="width:70px;"> &nbsp;
			제품명 <input type="text" id="findPrdNm" class="inputBox" style="width:100px;"> &nbsp;
			<input type="button" onClick="grid01List(1)" value="검 색" class="inputBtn">&nbsp;
			<input type="button" onClick="fnSearchReset()" value="Reset" class="inputBtn">
		</td>
	</tr>
</table>
</div>
<!-- 검색 영역 끝 -->


<br>

<!-- 그리드 시작 -->
<div style="text-align:left">
<table border="0" cellpadding="0" cellspacing="0" width="1235" style="margin-left:5px;text-align:left">
	<tr>
		<td width="100%" class="lTD_trbl" valign="top" style="padding: 5px 5px 5px 5px;">
			<table border="0" cellpadding="0" cellspacing="0" width="600">
				<tr height="24">
					<td style="padding: 0 0 0 0;text-align:left;width:300px;"><input type="text" class="subTitle" style="width:80px;" value="거래명세서" ReadOnly>&nbsp;<a href="javascript:grid01List(1)">[새로고침]</a> &nbsp;</td>
					<td style="padding: 0 20px 0 0;" align="right" width="300"><B>Total :</B> <span id="grid01Cnt" style="font-weight:bold">0</span></td>
				</tr>
			</table>
			<table border="0" cellpadding="0" cellspacing="0" width="600"><tr><td style="background-color:#3366CC;height:2px"></td></tr></table>				
			<div id="grid1">
				<div id="gridHeader1">
					<div style="width:40px"><p>코드</p></div>
					<div style="width:100px"><p>거래처</p></div>
					<div style="width:114px"><p>내 역</p></div>
					<div style="width:80px"><p>발행일</p></div>
					<div style="width:80px"><p>금액</p></div>
					<div style="width:80px"><p>부가세</p></div>
					<div style="width:80px"><p>총금액</p></div>
					<div style="width:18px">&nbsp;</div>
				</div>
				<div id="noResult1">
					<div><p>결과가 없습니다.</p></div>
				</div>
				<div id="gridBody1" style="display:none;">								
				</div>
				<div id="gridTail1" style="">
					<div class="term"></div>
					<div id="pager1"></div>
				</div>
			</div>			
		</td>
		<td valign="top" style="text-align:center; padding-left:5px">					
			<table border="0" cellpadding="0" cellspacing="0" width="620">
				<form name="frmOrder">
				<tr>
				  <td width="100%" class="lTD_trbl" style="padding: 5px 5px 5px 5px; text-align:center">
					<table border="0" cellpadding="0" cellspacing="0" width="610">
						<tr>
							<td height="30" width="610" class="lTD_00b0" style="padding: 0 0 0 30px; text-align:left; font-weight:bold">
								거래 &nbsp; &nbsp; 코드 : &nbsp;<input type="text" id="billCd" size="5" readonly="readonly" class="inputBox"> &nbsp; &nbsp; &nbsp;
								거 &nbsp; 래 &nbsp; 처 :  &nbsp;<input type="text" id="compNm" size="22" class="inputBox" style="margin-left:4px" onblur="fnFindCompany(this.value,'','compCd')"> &nbsp;&nbsp; 
								<select id="compCd" style="width:150px"><option value="">--거래처--</option></select>
							</td>
						</tr>
						<tr>
							<td height="30" width="610" class="lTD_00b0" style="padding: 0 0 0 30px; text-align:left; font-weight:bold">
								내 &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; 역 &nbsp;: &nbsp;<input type="text" id="income" class="inputBox" style="margin-right:55px;width:240px;">
								발 &nbsp; 행 &nbsp; 일 &nbsp;: &nbsp;<input type="text" id="incomeDt" size="11" class="inputBox" value="<%=date()%>" style="text-align:center;">
							</td>
						</tr>
						<tr>
							<td height="30" width="610" class="lTD_00b0" style="padding: 0 0 0 30px; text-align:left; font-weight:bold">
								금 &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; 액 &nbsp;: &nbsp;<input type="text" id="orgAmount" class="inputBox" style="text-align:right;margin-right:70px;width:150px;" onKeyup="commify2(this)" onBlur="fnAutoTax(this,'tax')">
								부 &nbsp; 가 &nbsp; 세 &nbsp;: &nbsp;<input type="text" id="tax" class="inputBox" style="text-align:right;width:150px;" onKeyup="commify2(this)" onBlur="fnGetTotal('orgAmount', this, 'amount')">
							</td>
						</tr>
						<tr>
							<td height="30" width="610" class="lTD_00b0" style="padding: 0 0 0 30px; text-align:left; font-weight:bold">
								총 &nbsp; 금 &nbsp; 액 &nbsp; : &nbsp;<input type="text" id="amount" class="inputBox" style="text-align:right;margin-right:75px;width:150px;" onKeyup="commify2(this)">		
								부 &nbsp; &nbsp; &nbsp; &nbsp; 서 &nbsp;: &nbsp;<select id="part"> 
									<option value="">-부서-</option>
									<%=partOptions%>
								</select> 
								<select id="flag" style="display:none">
									<option value="Y">유효</option>
									<option value="N">무효</option>
								</select>
							</td>
						</tr>
						<tr>
							<td height="30" width="610" class="lTD_00b0" style="padding: 0 0 0 30px; text-align:left; font-weight:bold">
								메 &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; 모 &nbsp;: &nbsp;<input type="text" id="billMemo" class="inputBox" style="margin-right:55px;width:420px;">
							</td>
						</tr>
						<tr>
							<td height="30" width="610" class="lTD_00b0" style="padding: 0 22px 0 30px; font-weight:bold">
								<input type="text" id="accessInfo" style="font-weight:normal;width:397px; border:0px;display:none;">
								E-mail : <input type="text" id="toEmail" style="width:150px;margin-right:3px" class="inputBox">
								<input type="button" value="메일발송" class="inputBtn" id="btnMail" onClick="fnEmail()" style="margin-right:70px">
								<span style="text-align:right">				
									<input type="button" value="인쇄" class="inputBtn" onClick="fnPrint()">
									<input type="button" value="저장" class="inputBtn" id="btnSave1" style="display:" onClick="fnSave()"> 
									<input type="button" value="신규" class="inputBtn" onClick="fnReset();fnResetArticle();grid02List(1);">
								</span>
							</td>
						</tr>
					</table>
				  </td>
				</tr>
				</form>
			</table>			
			<table border="0" cellpadding="0" cellspacing="0" width="620" style="margin-top:5px">
				<input type="text" style="display:none" id="rank">
				<tr>
				  <td width="100%" class="lTD_trbl" style="padding: 5px 5px 5px 5px; text-align:center">
					<table border="0" cellpadding="0" cellspacing="0" width="600" style="margin-top:10px">
						<tr height="24">
							<td style="padding: 0 0 0 0;text-align:left" width="300"><input type="text" class="subTitle" style="width:80px;" value="품목" ReadOnly>&nbsp;<a href="javascript:grid02List(1)">[새로고침]</a> &nbsp; </td>
							<td style="padding: 0 20px 0 0;" align="right" width="300"><B>Total :</B> <span id="grid02Cnt" style="font-weight:bold">0</span></td>
						</tr>
					</table>
					<table border="0" cellpadding="0" cellspacing="0" width="600"><tr><td style="background-color:#3366CC;height:2px"></td></tr></table>	
					<div id="grid2">
						<div id="gridHeader2">
							<div style="width:40px"><p>No.</p></div>
							<div style="width:185px"><p>품목명</p></div>
							<div style="width:100px"><p>주문번호</p></div>
							<div style="width:70px"><p>수량</p></div>
							<div style="width:80px"><p>단가</p></div>
							<div style="width:100px"><p>총금액</p></div>
							<div style="width:18px">&nbsp;</div>
						</div>
						<div id="noResult2">
							<div><p>결과가 없습니다.</p></div>
						</div>
						<div id="gridBody2" style="display:none;">								
						</div>
						<div id="gridTail2" style="">
							<div class="term"></div>
							<div id="pager2"></div>
						</div>		
					</div>		
					<table border="0" cellpadding="0" cellspacing="0" width="610">
						<tr>
							<td height="30" width="610" class="lTD_00b0" style="padding: 0 0 0 30px; text-align:left; font-weight:bold">
								Lot&nbsp; No : &nbsp;<input type="text" id="fullLotNo" size="10" class="inputBox" readonly> - <input type="text" id="lotSubNo" size="2" class="inputBox" style="margin-right:15px" readonly>
								품 목 명 &nbsp;: &nbsp;<input type="text" id="prdNm" size="20" class="inputBox" style="margin-right:15px">
								주문 번호 &nbsp;: &nbsp;<input type="text" id="orderNo" size="13" class="inputBox">
							</td>
						</tr>
						<tr>
							<td height="30" width="610" class="lTD_00b0" style="padding: 0 0 0 30px; text-align:left; font-weight:bold">
								단 &nbsp; &nbsp; 가 : &nbsp; <input type="text" id="unitPrice" size="12" class="inputBox" style="text-align:right;margin-right:47px" onKeyup="commify2(this)"> 
								수 &nbsp; &nbsp; 량  : &nbsp;<input type="text" id="goodQty" size="12" class="inputBox" style="text-align:right;margin-right:35px" onKeyup="commify2(this)" onBlur="fnGetArticleTotal()"> 
								총 &nbsp; &nbsp; 액  : &nbsp;<input type="text" id="totalPrice" size="12" class="inputBox" style="text-align:right;" onKeyup="commify2(this)"> 
							</td>
						</tr>
						<tr>
							<td height="30" width="610" class="lTD_00b0" style="padding: 0 0 0 10px; text-align:left; font-weight:bold">
								발주처 코드 : &nbsp; <input type="text" id="orderPrdCd" class="inputBox" style="width:100px;margin-right:25px"> 
								<select name="articleFlag" id="articleFlag">
									<option value="Y">유효</option>
									<option value="N">무효</option>
								</select> &nbsp; &nbsp;<input type="text" id="accessInfo" style="font-weight:normal;width:193px; border:0px">
								<span>
									<input type="button" value="저장" class="inputBtn" id="btnSave2" onClick="fnSaveArticle()" style="margin-right:1px"> 
									<input type="button" value="신규" class="inputBtn" onClick="fnResetArticle()">
								</span>
							</td>
						</tr>
					</table>
			
				  </td>
				</tr>
				</form>
			</table>
		</td>		
	</tr>
</table>
</div>
<!-- 그리그 끝 -->

<script language="javascript">
	setMainMenu();
//	//## 테스트를 위한 기본 값세팅	
//	$("#prdNm").val("연습00");
//	$("#etcPrdCd").val("TEST01-00");
//	$("#remarks").val("연습중\r\nThis is testing....");
</script>
</BODY>
</HTML>